* {
  box-sizing: border-box;
}

body {
  /* font-family: ; */
  /* height: 100vh; */
  /* overflow: auto; */
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.container {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.box {
  width: 350px;
  height: 200px;
  background-image: linear-gradient(45deg, rgb(255, 199, 199), rgb(255, 243, 173));
  color: #fff;
  margin: 20px auto;
  border-radius: 10px;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateX(400%);
  transition: transform 0.4s ease;
}

.box:nth-of-type(even) {
  transform: translateX(-400%);
}

.box.show{
  transform: translateX(0);
}

.box h2 {
  font-size: 50px;
/*   
  格式化高度来实现水平垂直居中，很明显不适合这个场景
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto; */
}

